package com.laiyima.zhongjiang.linghuilv.demo.view;

import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.laiyima.zhongjiang.linghuilv.demo.R;
import com.lxj.xpopup.impl.PartShadowPopupView;
import android.content.BroadcastReceiver;

/**
 * Description:
 * Create by dance, at 2018/12/21
 */
public class CustomPartShadowPopupView extends PartShadowPopupView {
    private Button all, benlance,tuiguang;

    public CustomPartShadowPopupView(@NonNull Context context) {
        super(context);
    }
    @Override
    protected int getImplLayoutId() {
        return R.layout.custom_part_shadow_popup;
    }

    TextView text;
    @Override
    protected void onCreate() {
        super.onCreate();
        text = findViewById(R.id.text);
        all=findViewById(R.id.bd_all);
        benlance=findViewById(R.id.bd_benlance);
        tuiguang=findViewById(R.id.bd_tuiguang);
        Log.e("tag","CustomPartShadowPopupView onCreate");
        all.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                all.setTextColor(Color.parseColor("#FFFFFFFF"));
                all.setBackgroundResource(R.drawable.list_button_press);

                benlance.setTextColor(Color.parseColor("#333333"));
                benlance.setBackgroundResource(R.drawable.list_button);
                tuiguang.setTextColor(Color.parseColor("#333333"));
                tuiguang.setBackgroundResource(R.drawable.list_button);;
            }
        });
        benlance.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
             benlance.setTextColor(Color.parseColor("#FFFFFFFF"));
             benlance.setBackgroundResource(R.drawable.list_button_press);;

             all.setTextColor(Color.parseColor("#333333"));
             all.setBackgroundResource(R.drawable.list_button);
             tuiguang.setTextColor(Color.parseColor("#333333"));
             tuiguang.setBackgroundResource(R.drawable.list_button);








            }
        });
        tuiguang.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                tuiguang.setTextColor(Color.parseColor("#FFFFFFFF"));
                tuiguang.setBackgroundResource(R.drawable.list_button_press);
                all.setTextColor(Color.parseColor("#333333"));
                all.setBackgroundResource(R.drawable.list_button);
                benlance.setTextColor(Color.parseColor("#333333"));
                benlance.setBackgroundResource(R.drawable.list_button);
            }
        });
    }
     @Override
    protected void onShow() {
        super.onShow();
        Log.e("tag","CustomPartShadowPopupView onShow");
    }

    @Override
    protected void onDismiss() {
        super.onDismiss();
        Log.e("tag","CustomPartShadowPopupView onDismiss");
    }
}
